package com.x.thoth.app;

import com.x.thoth.cache.autoconfiguration.complex.ComplexCacheAutoConfiguration;
import com.x.thoth.cache.autoconfiguration.ehcache.XEhCacheAutoConfiguration;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author _G5niusX
 * @Date 2018/5/6 1:45
 */
@Service
public class PersonService {

    @Cacheable(cacheNames = "SYSTEM-CONFIG", cacheManager = XEhCacheAutoConfiguration.DEFAULT_X_EHCACHE_MANAGER)
    public List<Person> queryString(String test) {
        System.out.println("查询了数据库");
        List<Person> personList = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            Person person = new Person();
            person.setAge(i);
            person.setName("" + i);
            personList.add(person);
        }
        return personList;
    }


}
